# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=glibd
pkgver=2.1.0
pkgrel=4
pkgdesc="D bindings for the GLib C Utility Library"
url="https://github.com/gtkd-developers/GlibD"
arch="x86 x86_64 aarch64" # ldc
license="GPL-3.0-or-later"
makedepends="meson gobject-introspection-dev glib-dev ldc ldc-runtime gir-to-d"
subpackages="$pkgname-dev $pkgname-dbg"
source="https://github.com/gtkd-developers/GlibD/archive/v$pkgver/glibd-$pkgver.tar.gz
	fix-sonames.patch"
builddir="$srcdir/GlibD-$pkgver"

build() {
	LDFLAGS="$LDFLAGS -link-defaultlib-shared -g" meson \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--buildtype=plain \
		. output
	ninja -C output
}

check() {
	ninja -C output test
}

package() {
	DESTDIR="$pkgdir" ninja -C output install
}

sha512sums="2e00933e666f213ef5e38d3df5695966a76cdac067603e39d09f7ac8a5a4cab48ea498044de1d9daa2920609b7f8d6d5c090a666a6507a563bb896be2cc8c32f  glibd-2.1.0.tar.gz
d97413d6615788f456eaa762e0f384ac9f3a1739d669013cf07631719783b24b4db89cdbb9f8b58bb4e49ce71a7783cf3f0cd9f9bd2879aa739d140b9b0d1c40  fix-sonames.patch"
